package sgi.message;
/** Message of inserting all fields to data_layer subscription if user is a customer and he didnt subscribe yet  */
@SuppressWarnings("serial")
public class MessageDataLayer extends Message {
	private String UserName;
	private int Commerce;
	private int Infrastracture;
	private boolean valid;
	private String notif;
	private String qCheckhasSubscription;
	private String qCountSubscriptions;
	private String qHistory;
	
	public MessageDataLayer(String UserName,int Commerce, int Infrastracture) {
		super("select * from customers where username='"+ UserName + "'");
		setqCheckhasSubscription("select COUNT(*) from  data_layer_subscription where username = '"+ UserName + "'");
		this.setUserName(UserName);
		this.setCommerce(Commerce);
		this.setInfrastracture(Infrastracture);
		setqCountSubscriptions("select COUNT(subscription_id) from data_layer_subscription");
		setqHistory("INSERT INTO `sgi`.`history_purchase` (`username`, `description`) VALUES ('"+UserName+"', 'Data Layer Subscription-"+(Commerce==1 ? "Commerce" : "Ifrastractue")+"');");
	}
	public String getUserName() {
		return UserName;
	}
	public void setUserName(String userName) {
		UserName = userName;
	}
	public int getCommerce() {
		return Commerce;
	}
	public void setCommerce(int commerce) {
		Commerce = commerce;
	}
	public int getInfrastracture() {
		return Infrastracture;
	}
	public void setInfrastracture(int infrastracture) {
		Infrastracture = infrastracture;
	}
	public boolean isValid() {
		return valid;
	}
	public void setValid(boolean valid) {
		this.valid = valid;
	}
	public String getNotif() {
		return notif;
	}
	public void setNotif(String notif) {
		this.notif = notif;
	}
	public String getqCheckhasSubscription() {
		return qCheckhasSubscription;
	}
	public void setqCheckhasSubscription(String qCheckhasSubscription) {
		this.qCheckhasSubscription = qCheckhasSubscription;
	}
	public String getqCountSubscriptions() {
		return qCountSubscriptions;
	}
	public void setqCountSubscriptions(String qCountSubscriptions) {
		this.qCountSubscriptions = qCountSubscriptions;
	}
	public String getqHistory() {
		return qHistory;
	}
	public void setqHistory(String qHistory) {
		this.qHistory = qHistory;
	}
}
